<template>
    <section>
      <el-form label-width="80px">
        <el-form-item label="店铺名称">
          <el-input type="text" v-model="model.name" placeholder="输入店铺名称" @keyup.native="onTextChange"></el-input>
        </el-form-item>
      </el-form>
    </section>
</template>

<script>
    export default {
      props:{
        publishing:{
          type:Object,
          default:null
        }
      },
      data(){
        return{
          model:{
            id:0,
            name:''
          },
        }
      },
      methods:{
        onTextChange(val){
          this.$emit("update:publishing",this.model)
        }
      },
      mounted(){
        if(this.publishing != null && this.publishing.name) {
          this.model = this.publishing;
        }
      }
    }
</script>

<style scoped>

</style>
